const more_point = require("../models/more_point")

var express = require('express');
var router = express.Router();

var formidable = require('formidable');

router.post('/', (req, res) => {
    var form = new formidable.IncomingForm();
    form.parse(req, function(err, fields) {
        if(err) {
            res.json({'state': false, 'msg': err})
        }else {
            more_point.find({
                pointId: fields.pointId
            }, (err, doc) => {
                if(err) {
                    res.json({'state': false, 'msg': err})
                }else {
                    res.json({
                        'state': true,
                        'more_point': doc
                    })
                }
            })
        }
    });
});

module.exports = router;